package com.yy.wga.goods.feign.api;

import com.yy.wga.common.core.dto.Result;
import com.yy.wga.goods.feign.request.SharerProductSetCommissionReq;
import com.yy.wga.goods.feign.request.SharerSetCommissionReq;
import com.yy.wga.goods.feign.response.PromoterStatusResp;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;

@FeignClient(name = "PromoterFeign",
        url = "https://wga-api.xianrcj.com/api/wechat/mp/",
        path = "/api/promoter/")
public interface PromoterFeign {

    /**
     * 获取推客状态
     *
     * @param openId
     */
    @GetMapping("/getPromoterStatus")
    Result<PromoterStatusResp> getPromoterStatus(@RequestParam("openId") String openId);

    /**
     * 设置推客佣金
     *
     * @param req req
     * @return void
     */
    @PostMapping("/setSharerCommission")
    Result<Void> setSharerCommission(@RequestBody @Valid SharerSetCommissionReq req);

    /**
     * 设置推客单个商品佣金
     *
     * @param req req
     * @return void
     */
    @PostMapping("/setSharerProductCommission")
    Result<Void> setSharerProductCommission(@RequestBody @Valid SharerProductSetCommissionReq req);

    /**
     * 获取推客单个商品佣金
     *
     * @param spuId spuId
     * @return void
     */
    @PostMapping("/getSharerProductCommission")
    Result<Integer> getSharerProductCommission(@RequestParam("spuId") String spuId);
}
